#include "stdafx.h"
#include "ckElementRepositoryFactory.h"
#include "ckElementRepositoryAccess.h"
#include "ckElementRepositoryMySQL.h"

namespace ck
{
	ElementRepositoryFactory::ElementRepositoryFactory()
	{
	}


	ElementRepositoryFactory::~ElementRepositoryFactory()
	{
	}

	ElementRepositoryFactory* ElementRepositoryFactory::GetInstance()
	{
		static ElementRepositoryFactory g_elemReposFactory;
		return &g_elemReposFactory;
	}

	ElementRepository* ElementRepositoryFactory::GetElementRepository(ckDbType type)
	{
		ElementRepository* pRepository = NULL;
		switch (type)
		{
		case ckDbAccess:
		{
			static ElementRepositoryAccess g_elemReposAcess;
			ElementRepository::m_pInstance = &g_elemReposAcess;
			
		}
			break;
		case ckDbMySQL:
		{
			static ElementRepositoryMySQL g_elemReposMySQL;
			ElementRepository::m_pInstance = &g_elemReposMySQL;
		}
			break;
		case ckDbOracle:
			break;
		}

		return ElementRepository::GetInstance();
	}
}


